<script setup>
import { ref } from 'vue';

const emit = defineEmits(['closeModal'])

const modalOpen = ref(false)
const errorInfo = ref('')
const init = (msg) => {
  modalOpen.value = true
  errorInfo.value = msg
}
const confirm = () => {
  modalOpen.value = false
  emit('closeModal')
}

defineExpose({
  init
})

</script>

<template>
  <a-modal 
    width="40%"
    v-model:open="modalOpen" 
    title="异常信息" 
    :bodyStyle="{'padding': '20px','height': '600px','overflow-y': 'auto'}"
    :maskClosable="false"
    destroyOnClose
    >
    {{ errorInfo }}
    <template #footer>
      <a-button type="primary" @click="confirm">确定</a-button>
    </template>
  </a-modal>
</template>

<style lang="scss" scoped>

</style>